<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("title", "我的足迹");
%>
<%@ include file="/WEB-INF/views/shared/master/weContentHeader.jsp"%>
<style type="text/css">
.head .weui-cell:before{
	border-top: none;
}
.head .weui-cell{
	line-height: 0px;
	padding-top: 3px;	

}

.end .weui-cell{
	padding-bottom: 0px;	
}
</style>
<%@ include file="/WEB-INF/views/shared/master/weTitle.jsp"%>
<div class="goback" data-back-point="personCenter"></div>	

<input type="hidden" id="pageNum" value="1" />
<div class="tab-container" data-id="claim-container" id="claim-tab">
		<ul class="tab tab-horizontal" style="" id="first-menu">
			<li data-id="tab1" id="artical" class="content active" style="width:50%">
			<input type="hidden" value="artical" />
				<span>资讯</span>
			</li>
			<li data-id="tab2" id="videoType" class="content" style="width:50%">
			<input type="hidden" value="video" />
				<span>视频</span>
			</li>
		</ul>
</div>
<div class="weui-panel_body" style="height:24rem; overflow: scroll;">

</div>
<div class="weui-loadmore bottomLoadding" hidden style="background-color: white; width: 85%">
		<i class="weui-loading"></i> <span class="weui-loadmore__tips">正在加载</span>
</div>
<div class="weui-loadmore weui-loadmore_line bottomNomore" hidden style="background-color: white; width: 85%">
		<span class="weui-loadmore__tips">没有更多了..</span>
</div>

<%@ include file="/WEB-INF/views/shared/scripts/jquery.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/jqweui.jsp"%>
<%@ include file="/WEB-INF/views/shared/scripts/tabmob.jsp"%>
<script type="text/javascript">
$(function(){
	var pageNum =1 ;
	var type="artical";
	var url = $.getVirtualPath()+"/wechat/cust/colAndFoot/collectionList?type="+type+"&pageNum="+pageNum;
	var html=$.getText(url);
	$(".weui-panel_body").html(html);
	activety(type,pageNum);
})
$(function(){
	$(".content").on("click",function(){
		var pageNum =1 ;
		var type=$(this).children("input:first").val();
		var url = $.getVirtualPath()+"/wechat/cust/colAndFoot/collectionList?type="+type+"&pageNum="+pageNum;
		var html=$.getText(url);
		$(".weui-panel_body").html(html);
		activety(type,pageNum);
	})
})
function activety(type,pageNum){

	$(".weui-panel_body").scroll(
			function() {
				var $this = $(this);
				viewH = $(this).height();//可见高度 
				contentH = $(this).get(0).scrollHeight;//内容高度
				scrollTop = $(this).scrollTop();//滚动高度
				if (contentH - viewH - scrollTop == 0) {
					console.log(type+"----------------"+pageNum);
					$(".bottomLoadding").show();
					console.log(pageNum+"====="+$(".allPage").val());
					pageNum++;
					if (pageNum <= $(".allPage").val()) {
						setTimeout(function() {
							var url = $.getVirtualPath()+"/wechat/cust/colAndFoot/collectionList?type="+type+"&pageNum="+pageNum;
							var html=$.getText(url);
							 $(".weui-panel_body").html(
									$(".weui-panel_body").html() + html); 
						}, 10);
						setTimeout(function() {
							$(".bottomLoadding").hide();
							console.log("隐藏");
						}, 10);
					} else {
						$(".bottomNomore").show();
						$(".bottomLoadding").hide();

						setTimeout(function() {
							$(".bottomNomore").hide();
						}, 2000);
					} 
				}
			})
}
</script>
<%@ include file="/WEB-INF/views/shared/master/weContentFooter.jsp"%>